//USBTest.java
package com.ylaihui.oop12;

interface USB{
	void start();
	void stop();
}
interface ReadData{
	void read();
}

class FlashMemory implements USB, ReadData{

	@Override
	public void start() {
		System.out.println("flash memory start!");
	}

	@Override
	public void stop() {
		System.out.println("flash memory stop!");		
	}

	@Override
	public void read() {		}
}

class Printer implements USB{
	@Override
	public void start() {		
		System.out.println("Printer stop!");		
	}

	@Override
	public void stop() {		
		System.out.println("Printer stop!");		
	}
}

class Computer{
	public void transdata(USB usb){
		usb.start();
		System.out.println("computer trans data...");
		usb.stop();
	}
}

public class USBTest {
	public static void main(String[] args) {
		Computer c = new Computer();
		c.transdata(new Printer());
		
		c.transdata(new FlashMemory());
	}

}
